﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/BaseInfoMaster.master"
    CodeFile="EditConsumerHisDetail.aspx.cs" Inherits="EditConsumerHisDetail" CodeFileBaseClass="Frame.Pages.BaseInfomationEditBasePage" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2.Linq, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
    <link type="text/css" rel="stylesheet" href="../Content/Site.css" />
    <link type="text/css" rel="stylesheet" href="../Content/CodeFormatter.css" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1 class="DemoTitle">
        消费记录管理
        <asp:HyperLink ID="BackLink" runat="server">返回</asp:HyperLink>
    </h1>
    <div id="DemoArea">
        <div class="Spacer" style="height: 14px;">
        </div>
        <dx:ASPxRoundPanel ID="Detailpanel" runat="server" Width="600px" HeaderText="客户基本信息"
            CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" EnableDefaultAppearance="False"
            GroupBoxCaptionOffsetX="6px" GroupBoxCaptionOffsetY="-19px" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
            <ContentPaddings PaddingBottom="10px" PaddingLeft="7px" PaddingRight="11px" PaddingTop="10px" />
            <HeaderStyle>
                <Paddings PaddingBottom="6px" PaddingLeft="7px" PaddingRight="11px" PaddingTop="1px" />
            </HeaderStyle>
            <PanelCollection>
                <dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
                    <table width="100%" style="font-size: 10pt">
                        <tr>
                            <td style="white-space: nowrap">
                                客户姓名:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_CName" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                手机号:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_PhoneNum" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                部门:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Department" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                性别:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Sex" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                车牌/车名/颜色:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Car" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                重要客户:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_IsVip" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                关联单位:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_RefrenceCompany_ID" Wrap="true" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                职位，头衔:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Position" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                单位名称:
                            </td>
                            <td colspan="3">
                                <dx:ASPxLabel Width="400px" ID="View_Company" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                地址:
                            </td>
                            <td colspan="3">
                                <dx:ASPxLabel Width="400px" ID="View_Address" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                喜好，口味:
                            </td>
                            <td colspan="3">
                                <dx:ASPxLabel Width="400px" ID="View_Favor" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                备注:
                            </td>
                            <td colspan="3">
                                <dx:ASPxLabel Width="400px" ID="View_Remark" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                    </table>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxRoundPanel>
        <div class="Spacer" style="height: 14px;">
        </div>
        <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="600px" HeaderText="消费基本信息"
            CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" EnableDefaultAppearance="False"
            GroupBoxCaptionOffsetX="6px" GroupBoxCaptionOffsetY="-19px" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
            <ContentPaddings PaddingBottom="10px" PaddingLeft="7px" PaddingRight="11px" PaddingTop="10px" />
            <HeaderStyle>
                <Paddings PaddingBottom="6px" PaddingLeft="7px" PaddingRight="11px" PaddingTop="1px" />
            </HeaderStyle>
            <PanelCollection>
                <dx:PanelContent ID="PanelContent2" runat="server" SupportsDisabledAttribute="True">
                    <table width="100%" style="font-size: 10pt">
                        <tr>
                            <td style="white-space: nowrap">
                                定金单号:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_BookNo" Font-Size="10pt" Wrap="true" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                消费时间:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_ConsumerDate" Font-Size="10pt" Wrap="true" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <td style="white-space: nowrap">
                                营业时段:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Preiod" Font-Size="10pt" Wrap="true" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                金额:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_Money" Wrap="true" Font-Size="10pt" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                        <tr>
                            <%--                            <td style="white-space: nowrap">
                                结账方式:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_ConsumerType" Font-Size="10pt" Wrap="true" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>--%>
                            <td style="white-space: nowrap">
                                桌数:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_TableCount" Font-Size="10pt" Wrap="true" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                            <td style="white-space: nowrap">
                                备注:
                            </td>
                            <td>
                                <dx:ASPxLabel Width="200px" ID="View_HisRemark" Font-Size="10pt" Wrap="true" runat="server"
                                    CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                </dx:ASPxLabel>
                            </td>
                        </tr>
                    </table>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxRoundPanel>
        <dx:ASPxGridView ID="gridView" runat="server" Width="100%" AutoGenerateColumns="False"
            CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" DataSourceID="LSMDSourceMain"
            KeyFieldName="ConsumNo" OnRowInserting="gridView_RowInserting">
            <SettingsDetail ShowDetailRow="true" />
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/DevEx/GridView/StatusBarLoading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <SettingsDetail AllowOnlyOneMasterRowExpanded="true" />
            <Columns>
                <dx:GridViewDataTextColumn Name="t_ConsumNo" FieldName="ConsumNo" VisibleIndex="0"
                    CellStyle-HorizontalAlign="Left" Caption="消费流水号">
                    <PropertiesTextEdit MaxLength="50" Native="true" Width="260px">
                        <ValidationSettings CausesValidation="true">
                            <RequiredField IsRequired="true" ErrorText="消费流水号不可为空！"></RequiredField>
                        </ValidationSettings>
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_BookNo" FieldName="BookNo" Visible="false" VisibleIndex="1"
                    CellStyle-HorizontalAlign="Left" Caption="订金单号">
                    <PropertiesTextEdit MaxLength="50" Native="true" Width="260px">
                        <ValidationSettings CausesValidation="true">
                            <RequiredField IsRequired="true" ErrorText="订金单号不可为空！"></RequiredField>
                        </ValidationSettings>
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn Name="t_Table_ID" FieldName="Table_ID" VisibleIndex="2"
                    CellStyle-HorizontalAlign="Left" Caption="桌台号">
                    <PropertiesComboBox Width="260px" Style-Font-Size="10pt">
                        <Style Font-Size="10pt"></Style>
                    </PropertiesComboBox>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataMemoColumn Name="t_Remark" FieldName="Remark" VisibleIndex="3" CellStyle-HorizontalAlign="Left"
                    Caption="备注">
                    <PropertiesMemoEdit Width="300px" Height="100px">
                    </PropertiesMemoEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Left">
                    </CellStyle>
                </dx:GridViewDataMemoColumn>
                <dx:GridViewDataTextColumn Name="t_Money" FieldName="Money" VisibleIndex="4" CellStyle-HorizontalAlign="Right"
                    Caption="金额">
                    <PropertiesTextEdit Width="260px">
                        <MaskSettings Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" IncludeLiterals="DecimalSymbol">
                        </MaskSettings>
                        <ValidationSettings CausesValidation="true">
                            <RequiredField IsRequired="true" ErrorText="金额不可为空！"></RequiredField>
                        </ValidationSettings>
                    </PropertiesTextEdit>
                    <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                    <CellStyle HorizontalAlign="Right">
                    </CellStyle>
                </dx:GridViewDataTextColumn>
            </Columns>
            <Templates>
                <DetailRow>
                    <dx:ASPxGridView ID="DgridView" runat="server" Width="100%" AutoGenerateColumns="False"
                        CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" DataSourceID="DLSMDSourceMain"
                        KeyFieldName="HisListID" OnLoad="DgridView_Load" OnRowInserting="DgridView_RowInserting">
                        <SettingsDetail IsDetailGrid="true" />
                        <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                            </Header>
                            <LoadingPanel ImageSpacing="5px">
                            </LoadingPanel>
                        </Styles>
                        <ImagesFilterControl>
                            <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                            </LoadingPanel>
                        </ImagesFilterControl>
                        <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                            <LoadingPanelOnStatusBar Url="~/App_Themes/DevEx/GridView/StatusBarLoading.gif">
                            </LoadingPanelOnStatusBar>
                            <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                            </LoadingPanel>
                        </Images>
                        <Columns>
                            <dx:GridViewDataTextColumn Name="t_HisListID" Visible="false" FieldName="HisListID"
                                VisibleIndex="0" CellStyle-HorizontalAlign="Left">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Name="t_ConsumeNo" Visible="false" FieldName="ConsumeNo"
                                VisibleIndex="0" CellStyle-HorizontalAlign="Left" Caption="消费流水编码">
                                <PropertiesTextEdit MaxLength="50" Native="true" Width="260px">
                                    <ValidationSettings CausesValidation="true">
                                        <RequiredField IsRequired="true" ErrorText="消费流水编码不可为空！"></RequiredField>
                                    </ValidationSettings>
                                </PropertiesTextEdit>
                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataComboBoxColumn Name="t_Dish_ID" FieldName="Dish_ID" VisibleIndex="1"
                                CellStyle-HorizontalAlign="Left" Caption="菜品">
                                <PropertiesComboBox Width="260px" DataSourceID="SqlDataSourceMain" TextField="DishName;Value;"
                                    DropDownStyle="DropDownList" ValueType="System.String" ValueField="Dish_ID">
                                    <Columns>
                                        <dx:ListBoxColumn FieldName="Dish_ID" Caption="菜品编码" />
                                        <dx:ListBoxColumn FieldName="DishName" Caption="菜品名称" />
                                        <dx:ListBoxColumn FieldName="DishType" Caption="菜品类型" />
                                        <dx:ListBoxColumn FieldName="Unit_ID" Caption="菜品单位" />
                                        <dx:ListBoxColumn FieldName="Value" Caption="单价" />
                                    </Columns>
                                </PropertiesComboBox>
                            </dx:GridViewDataComboBoxColumn>
                            <dx:GridViewDataTextColumn Name="t_Count" FieldName="Count" VisibleIndex="2" CellStyle-HorizontalAlign="Right"
                                Caption="数量">
                                <PropertiesTextEdit Width="260px">
                                    <MaskSettings Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" IncludeLiterals="DecimalSymbol">
                                    </MaskSettings>
                                </PropertiesTextEdit>
                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Name="t_Money" FieldName="Money" VisibleIndex="3" CellStyle-HorizontalAlign="Right"
                                Caption="金额">
                                <PropertiesTextEdit Width="260px">
                                    <MaskSettings Mask="&lt;0..99999g&gt;.&lt;00..99&gt;" IncludeLiterals="DecimalSymbol">
                                    </MaskSettings>
                                </PropertiesTextEdit>
                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <StylesEditors ButtonEditCellSpacing="0">
                            <ProgressBar Height="21px">
                            </ProgressBar>
                        </StylesEditors>
                        <SettingsEditing EditFormColumnCount="1" />
                    </dx:ASPxGridView>
                    <dx:LinqServerModeDataSource ID="DLSMDSourceMain" runat="server" EnableDelete="true"
                        EnableUpdate="true" EnableInsert="true" ContextTypeName="DAL.CMSDALDataContext"
                        TableName="BLI_ConsumerHisList" OnSelecting="DLSMDSourceMain_Selecting" />
                </DetailRow>
            </Templates>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
            <SettingsEditing EditFormColumnCount="1" />
        </dx:ASPxGridView>
        <dx:LinqServerModeDataSource ID="LSMDSourceMain" runat="server" EnableDelete="true"
            EnableUpdate="true" EnableInsert="true" ContextTypeName="DAL.CMSDALDataContext"
            TableName="BLI_ConsumerHisDetail" />
        <asp:SqlDataSource ID="SqlDataSourceMain" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>"
            SelectCommand="Select      Dish_ID=a.DishID,
                                       DishName,
		                               DishType = b.TypeName,
		                               Unit_ID, 
		                               Value
                              from   BI_Dish a,BI_DishType b 
                              where  a.Type_ID = b.DishTypeID " runat="server" ProviderName="<%$ ConnectionStrings:CMSConnectionString.ProviderName %>">
        </asp:SqlDataSource>
    </div>
</asp:Content>
